package com.mt.roll.core.dal.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.baomidou.mybatisplus.annotation.Version;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableField;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 工厂
 * </p>
 *
 * @author mt
 * @since 2021-12-30
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_factory")
public class Factory extends Model<Factory> {

    private static final long serialVersionUID = 1L;

      @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    /**
     * 删除标志，是否有效:0 可用 1不可用
     */
    @TableField("valid")
    @TableLogic
    private Integer valid;

    /**
     * 添加时间
     */
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 创建人id
     */
    @TableField("creator_id")
    private Long creatorId;

    /**
     * 更新人id
     */
    @TableField("updater_id")
    private Long updaterId;

    /**
     * 修改时间
     */
    @TableField("update_time")
    private LocalDateTime updateTime;

    /**
     * 版本号 默认为 1
     */
    @TableField("version")
    @Version
    private String version;

    /**
     * 状态		0初始化
     */
    @TableField("status")
    private Integer status;

    /**
     * 内部编码
     */
    @TableField("inter_code")
    private String interCode;

    /**
     * 工厂编码
     */
    @TableField("code")
    private String code;

    /**
     * 工厂名称
     */
    @TableField("factory_name")
    private String factoryName;

    /**
     * 工厂地址
     */
    @TableField("address")
    private String address;

    /**
     * 描述信息
     */
    @TableField("description")
    private String description;

    /**
     * 备注
     */
    @TableField("note")
    private String note;


    public static final String ID = "id";

    public static final String VALID = "valid";

    public static final String CREATE_TIME = "create_time";

    public static final String CREATOR_ID = "creator_id";

    public static final String UPDATER_ID = "updater_id";

    public static final String UPDATE_TIME = "update_time";

    public static final String VERSION = "version";

    public static final String STATUS = "status";

    public static final String INTER_CODE = "inter_code";

    public static final String CODE = "code";

    public static final String FACTORY_NAME = "factory_name";

    public static final String ADDRESS = "address";

    public static final String DESCRIPTION = "description";

    public static final String NOTE = "note";

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
